home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cppdll / readme.doc < prev    next >
Text File  |  1990-03-07  |  2KB  |  30 lines

  1. Enclosed you'll find a simple example of the C++ class implemented as
  2. a DLL. What makes it possible, is the fact that a default C++ linkage 
  3. is identical to PASCAL. If you use compact/large model it becomes FAR
  4. PASCAL (just what the WINDOWS export function needs). To put your class 
  5. (or a cluster of them), compile them as any other class, and then create
  6. *.def file. All public methods must be exported, you can do that by listing
  7. their mangled names in an EXPORTS section of the *.def file. Mangled names
  8. can be found in a *.map file. You don't even have to read them, just cut and
  9. paste them into *.def.
  10. My approach seems to work well ( I haven't really tested it yet), but there 
  11. are two gotcha's you have to remember. 
  12. 1. Only the methods with a fixed number of arguments can be exported
  13. 2. It works only in a LARGE model.
  14.  
  15. The second requirement is due to the fact that size of 'this' pointer is
  16. based on the compilation model used. Since DLLs have own data segments an 
  17. object has to be referenced using a far pointer. From what I've heard far 
  18. classes will be implemented in the next release along with pointers to
  19. members (right Walter ?).
  20.  
  21. I am also enclosing two programming utilities (implemented as DLLs), they
  22. encapsulate color and font selection mechanism. Feel free to use, copy and
  23. distribute them. If you find them useful, I would appreciate your
  24. contribution of $25. See an About... box in the dialog box for details.
  25.  
  26. I will appreciate any comments, suggestions, improvements etc. Please post
  27. a message to Andy Mazur.
  28.  
  29.  
  30.